import { tween } from 'cc';
import { Enum } from 'cc';
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

export enum resourceType {
    WOOD,
    MEAT
}

@ccclass('resourceManager')
export class resourceManager extends Component {

    @property({type : Enum(resourceType)}) //攻击类型
    curType : resourceType = resourceType.WOOD;

    moveToHero(hero,callback){
        this.node["unCheck"] = true;
        tween(this.node)
            .to(0.2,{position : hero.position})
            .call(()=>{
                callback();
                this.node.destroy();
            })
            .start();
    }
}


